#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <set>
#include <queue>

using namespace std;
using LL = long long;
using PII = pair<int, int>;

int n, m;

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while(T--){
        cin >> n >> m;

        if(n > 2){
            for(int i = 1; i <= n - 2; i ++){
                for(int j = 1; j <= m; j ++){
                    cout << "B";
                }
                cout << '\n';
            }
        }
        for(int j = 1; j <= m; j ++){
            cout << "B";
        }
        cout << '\n';
        for(int j = 1; j <= m - 1; j ++){
            cout << "W";
        }
        cout << "B";
        cout << '\n';
    }



    return 0;
}
